﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ResponsibilityChain
{
    public class SchoolMasterApprove : Approve
    {
        public SchoolMasterApprove(string name)
        {
            this.Name = name;
        }

        public override void ProcessRequest(PurchRequest purchRequest)
        {
            if (purchRequest.GetPrice() >= 5000)
            {
                Console.WriteLine($"the id={purchRequest.GetId()} approved by {this.Name}");
            }
            else
            {
                this.Next.ProcessRequest(purchRequest);
            }
        }
    }
}
